package com.lkd.controller;

import com.lkd.dto.ChannelDTO;
import com.lkd.service.ChannelService;
import com.lkd.vo.ChannelVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: Z.lx
 * @Date: 2025/8/23 08:49
 * @Description:
 **/
@RestController
@RequestMapping("/api/vm-service/channel")
@AllArgsConstructor
@Slf4j
public class ChannelController {
    private final ChannelService channelService;

    /**
     * 获取售货机货到详情
     */
    @GetMapping("/channelList/{innerCode}")
    public List<ChannelVO> list(@PathVariable("innerCode") String innerCode) {
        log.info("获取售货机货到详情:{}", innerCode);
        return channelService.list(innerCode);
    }

    @PutMapping("/channelConfig")
    public Boolean config(@RequestBody ChannelDTO channelDTO) {
        log.info("配置货道:{}", channelDTO);
        return channelService.updateBatch(channelDTO);
    }
}
